(function (root) {
    root.Utils = {};
    root.Utils.rootUrl = '/';
    root.Utils.getUrl = function (url) {
        return this.rootUrl + url;
    };

    root.Utils.getPage = function (pageName) {
        return this.rootUrl + 'Content/views/pages/' + pageName + '.html';
    };

    root.Utils.getTemplate = function (templateName) {
        return this.rootUrl + 'Content/views/templates/' + templateName + '.html';
    };
    
    root.Utils.initPlugins = function() {
      if (root.ratchet) {
          root.ratchet.init();
      }  
    };

    root.Utils.isEmpty = function (val) {
        if (val == undefined) {
            return true;
        }

        var valType = typeof val;
        if (valType === 'string' && $.trim(val).length === 0) {
            return true;
        }

        if ($.isArray(val) && val.length == 0) {
            return true;
        }

        return false;
    };

    root.Utils.String = {};
    root.Utils.String.join = function (arr, separator) {
        var result = "";
        arr.forEach(function (item) {
            result += item;
            result += separator;
        });

        if (result.length > 0) {
            result = result.substr(0, result.length - separator.length);
        }

        return result;
    };
})(window);